# -*- coding: utf-8 -*-
import sys
sys.path.append("..")
from functools import reduce
import time
import re
import xlrd
import json
import pandas as pd
import numpy as np
import html as ht
from html5lib import HTMLParser
#from html.parser import HTMLParser
from fuzzywuzzy import fuzz
from fuzzywuzzy import process
from urllib.parse import quote
from urllib.parse import unquote
from urllib.parse import unquote_plus
from urllib.parse import urlencode


class HelloPython(object):
    """
    """

    #多行插入
    def read_xls(self):
        # 读取原文件
        workbook = xlrd.open_workbook(r'D:\\usr\\EJU\\数据部门\\大数据系统\\商业客户数据部\\极光提供-易居标签输出标准值2.xlsx')
        table = workbook.sheet_by_index(0)
        maxRow = table.nrows
        print("总记录数", maxRow)

        insertDataList = []
        dict = {}
        for rowNum in range(maxRow):
            #跳过第一行表头
            if rowNum == 0 :
                #跳过第一行表头
                header = table.row_values(rowNum)
                print(header)
                continue
            rowVale = table.row_values(rowNum)
            key = str(rowVale[0]).replace('.0', '')
            dict.setdefault(key, rowVale[1])
        print(len(dict))
        print(dict)



    jg_person_tags_09_sql = """
        insert into jg_person_tags_09(
            _id, order_id, city, loupan_name, type, tag, name, result, create_time
            ) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)
        """
    jg_person_tags_13_sql = """
        insert into jg_person_tags_13(
            _id, aParam, sMethod, sUrl, sName, aHeader, sProject, iPkinid, iCreateTime, iUpdateTime, iHttpCode, sBody, sRunResult
            ) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)
        """

    def test1(self):
        print(int(35/10 + 1))
        dict = {'13': 'sex', '21': 'age_group', '32': 'career', '231': 'is_college_stu', '232': 'education', '16': 'marriage', '11': 'have_child', '22': 'have_car', '24': 'income_level', '23': 'consume_power', '1': 'mobile_model', 'c1': 'mobile_brand', '4': 'operator', '5': 'system', '27': 'consume_level', '26': 'consume_prefer', '28': 'purchase_prefer', '29': 'surf_purpose', '30': 'read_prefer', '31': 'habit', 'b115': 'is_chinese', '6': 'mobile_value', 'b5': 'client_value', 'b6': 'active_city', 'b9': 'workday_traffic', 'b10': 'holiday_traffic', 'b11': 'app_prefer', 'b14': 'estate_app', 'b15': 'estate_app_freq', 'b16': 'app_use_dura', 'b17': 'app_use_freq', 'b31': 'purchase_app', 'b49': 'decorate_demand', 'b50': 'car_demand', 'b51': 'educate_demand', 'b58': 'travel_app', 'b59': 'long_traffic_prefer', 'b61': 'travel_abroad', 'b4': 'resi_district_price', 'b40': 'mall_prefer', 'b8': 'active_comarea', 'b2': 'have_house', 'b3': 'car_brand', 'b62': 'in_province_travel', 'b63': 'out_province_travel', 'b1': 'have_pet', 'b111': 'rent_city', 'b112': 'rent_county', 'b113': 'rent_estate', 'b114': 'rent_frequent', 'b12': 'freq_use_app', 'b13': 'app_use_time', 'b18': 'bank_prefer', 'b19': 'invest_prefer', 'b20': 'loan_prefer', 'b21': 'lottery_prefer', 'b22': 'live_prefer', 'b23': 'game_prefer', 'b24': 'health_care', 'b25': 'entertainment', 'b26': 'food_category', 'b27': 'convenience', 'b28': 'social_active_level', 'b29': 'social_prefer', 'b30': 'educate_prefer', 'b32': 'offline_brand_prefer', 'b33': 'offline_shop_prefer', 'b34': 'offline_brand_type', 'b35': 'is_visit_mall', 'b36': 'is_visit_gym', 'b37': 'is_visiti_hotel', 'b39': 'hotel_duration', 'b41': 'hotel_prefer_poi', 'b42': 'ent_prefer_poi', 'b43': 'ent_str_prefer_poi', 'b44': 'food_prefer_type', 'b45': 'food_prefer_poi', 'b46': 'gas_prefer_poi', 'b47': 'car_repair_poi', 'b52': 'weekend_entertain', 'b53': 'weekent_purchase', 'b54': 'poi_prefer_cate', 'b55': 'poi_str_prefer_cate', 'b56': 'is_weekend_travel', 'b57': 'travel_dest_type', 'b60': 'long_traffic_str_prefer', 'b64': 'travel_abroad_dest', 'b65': 'travel_month_prefer', 'b67': 'bustrip_city', 'b68': 'travel_prefer_poi', 'b69': 'travel_poi_duration', 'b7': 'resi_comarea', 'b70': 'insp_house_city', 'b71': 'insp_house_county', 'b72': 'insp_house_poi', 'b73': 'insp_house_freq', 'b38': 'hotel_brand_prefer', 'b66': 'hotel_level_prefer', 'b86': 'mall_prefer_lnglat', 'b85': 'insp_house_lnglat', '10': 'equip_cate', 'b48': 'buy_house_demand', 'b80': 'resi_address', 'b81': 'work_address', 'b82': 'resi_province', 'b83': 'resi_city', 'b84': 'resi_county'}
        a = 'asdf'
        f = "d:\\data\\%s.txt" %(a)
        obj = HelloPython()
        print(dict)
        tup1 = ('Google', 'Runoob', 1997, 2000)
        tup2 = (1, 2, 3, 4, 5, 6, 7 )
        tup2 = tup2.__add__(tup1)
        insert = 'insert into table ' + str(tup1) + ' values ' + str(tup2)
        print(insert)
        print(tup2)


    def testRe(self):
        text = '，财政收入：全市完成一般公共预算收入5817.1亿元，比上年增长0.5%。其中，增值税1820.9亿元，增长1.6%；企业所得税和个人所得税分别为1228.5亿元和544.2亿元，分别下降4.6%和25.3%。'
        pattern = re.compile('[；，。][^；，。]*增长[^；，。]*[；，。]') #[，。][^，。]*比上年增长[^，。]*[，。]
        search = pattern.findall(text)
        print(search)
        print(re.search(r"公共预算\w+?[^；，。]*[；，。]", text).group())
        href = 'test.htm, test.html, test.shtml, test.asp, test.aspx'
        match = re.findall(r'\.s*html*|\.aspx*', href, re.M|re.I)
        if match :
            print(match[0])
        for m in match :
            print(m)


        for m in re.finditer(r"公共预算\w+", text):
            print('%02d-%02d: %s' % (m.start(), m.end(), m.group(0)))

    def testFuzz(self):
        data=pd.read_excel("01-高德清洗v-01.xlsx")
        # data = data[data['is_accurate'] == '否']
        data['ratio']=data.apply(self.ratio, axis=1)
        data['city_match']=data.apply(lambda x:fuzz.partial_ratio(str(x['city_name']),str(x['gd_city'])),axis=1)
        print(data)

    def ratio(self, row):
        x = fuzz.partial_ratio(str(row['newest_name']),str(row['gd_office_name']))
        return x

    def testLambda(self):
        #先生成一个dataframe
        d = {"col1" : ["96%(1368608/1412722)",
                       "97%(1389916/1427922)",
                       "97%(1338695/1373803)",
                       "96%(1691941/1745196)",
                       "95%(1878802/1971608)",
                       "97%(944218/968845)",
                       "96%(1294939/1336576)"]}
        df1 = pd.DataFrame(d)

        #切分原文中识别率总数，采用apply + 匿名函数
        #lambda 函数的意思是选取x的序列值 ，比如 x[6:9]
        #index函数的意思是把当前字符位置转变为所在位置的位数
        #-1是最后一位
        df1['正确数'] = df1.iloc[:,0].apply(lambda x : x[x.index('(') + 1 : x.index('/')])
        df1['总数'] = df1.iloc[:,0].apply(lambda x : x[x.index('/') + 1 : -1])
        df1['正确率'] = df1.iloc[:,0].apply(lambda x : x[:x.index('(')])
        df1

    def testOher(self):
        data = {"name":"vivi"}
        print(type(data))
        data = json.dumps(data)
        print(type(data))
        print(data)

        url = 'http://ir.sohochina.com/NewsEvents.aspx?page='
        if url.find('%') > 0 :
            print(url % 1)
        else :
            print(url)
        content = "编码：&#33258;&#24895;&#20844;&#24067; &#33719;&#32435;&#20837;MSCI&#20013;&#22269;&#25351;&#25968;"
        content = ht.unescape(content)
        print(content)
        print(ht.escape('<a>你好</a>'))
        print(dir(ht))
        print(help(ht.unescape))
        str = " a / b \\ c : d * e ? f \" g < h > i | j \t k \n l \t m \n n ... o"
        print(len(str))
        print(re.sub('[/\\\.:*?"<>|\t \n]', '', str))
        url = 'http://www.auxint.com/documents/c_202091 _20200721_ESS.pdf'
        print(quote(url))
        w = '别名：海亮时代ONE,海亮新英里'.replace("别名：", '')
        a = '克拉公,abc'.split(',')
        a.sort()
        b = 'abc|克拉公def'.split('|')
        b.sort()
        print(','.join(a))
        print('【名称】VS【名称】相似度%s%%'%(90))
        r = fuzz.partial_ratio(''.join(a), ''.join(b))
        print(r)
        is_accurate = None
        if (is_accurate=='nan' or is_accurate is None) :
            print('is_accurate=', is_accurate)
            print('已修改'.__contains__('修改'))
            exit(1)

    def test_func(self):
        s = "1234567"
        s = list(s[1:5])  # 这里s实字符串类型
        s = map(int, s)  # 将s每个字符串转化成int类型,最后就转化成整数数字了
        s = list(s)
        li = [1, 2, 3, 4, 5]
        # 序列中的每个元素加1
        m = map(lambda x: x+1, li) # [2,3,4,5,6]
        m = list(m)
        print(m)

        # 返回序列中的偶数
        f = filter(lambda x: x % 2 == 0, li) # [2, 4]
        print(list(f))

        # 返回所有元素相乘的结果
        r = reduce(lambda x, y: x * y, li) # 1*2*3*4*5 = 120
        print(r)

if __name__ == "__main__":
    obj = HelloPython()
    print("kjfd.pdf".find(".") > 0)
    res = "{state: 1,info: '%3Cli%3E%0D%0A%3Cdl%3E%0D%0A%3Cdt%3E%0D%0A%3Cdiv%20class%3D%22news_time%20fnt_16%22%3E2021.05.13%3C/div%3E%0D%0A%3Ch3%20class%3D%22fnt_24%22%3E%3Ca%20href%3D%22/content/details32_5488.html%22%20target%3D%22_blank%22%3E%u6D77%u5916%u76E3%u7BA1%u516C%u544A%20-%202020%u5E74%u5E74%u5EA6%u80A1%u6771%u5927%u6703%u6C7A%u8B70%u516C%u544A%u3001%u5317%u4EAC%u5927%u6210%u5F8B%u5E2B%u4E8B%u52D9%u6240%u95DC%u65BC%u5317%u4EAC%u5317%u8FB0%u5BE6%u696D%u80A1%u4EFD%u6709%u9650%u516C%u53F82020%u5E74%u5E74%u5EA6%u80A1%u6771%u5927%u6703%u7684%u6CD5%u5F8B%u610F%u898B%u66F8%u3001%u7B2C%u4E5D%u5C46%u7B2C%u4E00%u6B21%u8463%u4E8B%u6703%u6C7A%u8B70%u516C%u544A%u53CA%u7B2C%u4E5D%u5C46%u7B2C%u4E00%u6B21%u76E3%u4E8B%u6703%u6C7A%u8B70%u516C%u544A%uFF08H%uFF09%3C/a%3E%3C/h3%3E%0D%0A%3C/dt%3E%0D%0A%3Cdd%3E%0D%0A%3Cp%20class%3D%22fnt_16%20line30%22%3E%u91CD%u8981%u5185%u5BB9%u63D0%u793A%uFF1A%20%0D%0A%20%20%20%20%u672C%u6B21%u4F1A%u8BAE%u662F%u5426%u6709%u5426%u51B3%u8BAE%u6848%uFF1A%u65E0%20%0D%0A%20%20%20%20%u4E00%u3001%20%u4F1A%u8BAE%u53EC%u5F00%u548C%u51FA%u5E2D%u60C5%u51B5%20%0D%0A%20%20%20%20%28%u4E00%29%20%u80A1%u4E1C%u5927%u4F1A%u53EC%u5F00%u7684%u65F6%u95F4%uFF1A2021%20%u5E74%205%20%u6708%2013%20%u65E5%20%3C/p%3E%0D%0A%3C/dd%3E%0D%0A%3C/dl%3E%0D%0A%3C/li%3E%0D%0A%3Cli%3E%0D%0A%3Cdl%3E%0D%0A%3Cdt%3E%0D%0A%3Cdiv%20class%3D%22news_time%20fnt_16%22%3E2021.05.13%3C/div%3E%0D%0A%3Ch3%20class%3D%22fnt_24%22%3E%3Ca%20href%3D%22/content/details32_5487.html%22%20target%3D%22_blank%22%3E%u8463%u4E8B%u540D%u55AE%u8207%u5176%u89D2%u8272%u548C%u8077%u80FD%uFF08H%uFF09%3C/a%3E%3C/h3%3E%0D%0A%3C/dt%3E%0D%0A%3Cdd%3E%0D%0A%3Cp%20class%3D%22fnt_16%20line30%22%3E%u5317%u4EAC%u5317%u8FB0%u5BE6%u696D%u80A1%u4EFD%u6709%u9650%u516C%u53F8%uFF08%u300C%u672C%u516C%u53F8%u300D%uFF09%u8463%u4E8B%u6703%uFF08%u300C%20%u8463%u4E8B%u6703%u300D%uFF09%u6210%u54E1%3C/p%3E%0D%0A%3C/dd%3E%0D%0A%3C/dl%3E%0D%0A%3C/li%3E%0D%0A%3Cli%3E%0D%0A%3Cdl%3E%0D%0A%3Cdt%3E%0D%0A%3Cdiv%20class%3D%22news_time%20fnt_16%22%3E2021.05.13%3C/div%3E%0D%0A%3Ch3%20class%3D%22fnt_24%22%3E%3Ca%20href%3D%22/content/details32_5486.html%22%20target%3D%22_blank%22%3E%u8463%u4E8B%u53CA%u76E3%u4E8B%u9078%u8209%u3001%u9078%u8209%u8463%u4E8B%u6703%u8463%u4E8B%u9577%u53CA%u59D4%u4EFB%u8463%u4E8B%u6703%u59D4%u54E1%u6703%u6210%u54E1%u53CA%u9078%u8209%u76E3%u4E8B%u6703%u4E3B%u5E2D%uFF08H%uFF09%3C/a%3E%3C/h3%3E%0D%0A%3C/dt%3E%0D%0A%3Cdd%3E%0D%0A%3Cp%20class%3D%22fnt_16%20line30%22%3E%u8463%u4E8B%u6703%u6B23%u7136%u516C%u4F48%28i%29%u7B2C%u4E5D%u5C46%u8463%u4E8B%u6703%u7684%u8463%u4E8B%u53CA%u7B2C%u4E5D%u5C46%u76E3%u4E8B%u6703%u7531%u80A1%u6771%u4EE3%u8868%u51FA%u4EFB%u7684%u76E3%u4E8B%u65BC%u4E8C%u96F6%u4E8C%u96F6%u5E74%u5E74%u5EA6%u80A1%u6771%u5927%u6703%u4E0A%u9078%u8209%u7522%u751F%uFF1B%u53CA%28ii%29%u7B2C%u4E5D%u5C46%u76E3%u4E8B%u6703%u7531%u8077%u5DE5%u4EE3%u8868%u51FA%u4EFB%u7684%u76E3%u4E8B%u5DF2%u7531%u672C%u516C%u53F8%u8077%u5DE5%u6C11%u4E3B%u9078%u8209%u7522%u751F%u3002%3C/p%3E%0D%0A%3C/dd%3E%0D%0A%3C/dl%3E%0D%0A%3C/li%3E%0D%0A%3Cli%3E%0D%0A%3Cdl%3E%0D%0A%3Cdt%3E%0D%0A%3Cdiv%20class%3D%22news_time%20fnt_16%22%3E2021.05.13%3C/div%3E%0D%0A%3Ch3%20class%3D%22fnt_24%22%3E%3Ca%20href%3D%22/content/details32_5485.html%22%20target%3D%22_blank%22%3E%u4E8C%u96F6%u4E8C%u96F6%u5E74%u5E74%u5EA6%u80A1%u6771%u5927%u6703%u6295%u7968%u7D50%u679C%u53CA%u6D3E%u767C%u80A1%u606F%u516C%u544A%uFF08H%uFF09%3C/a%3E%3C/h3%3E%0D%0A%3C/dt%3E%0D%0A%3Cdd%3E%0D%0A%3Cp%20class%3D%22fnt_16%20line30%22%3E%u8463%u4E8B%u6703%u6B23%u7136%u5BA3%u4F48%uFF0C%u4E8C%u96F6%u4E8C%u96F6%u5E74%u5E74%u5EA6%u80A1%u6771%u5927%u6703%u5DF2%u65BC%u4E8C%u96F6%u4E8C%u4E00%u5E74%u4E94%u6708%u5341%u4E09%u65E5%uFF08%u661F%20%u671F%u56DB%uFF09%u4E0A%u5348%u4E5D%u6642%u5728%u4E2D%u570B%u5317%u4EAC%u5E02%u671D%u967D%u5340%u5317%u8FB0%u6771%u8DEF8%u865F%u6ED9%u6B23%u5927%u5EC8A%u5EA712%u5C64%u7B2C%u4E00%20%u6703%u8B70%u5BA4%u8209%u884C%u3002%3C/p%3E%0D%0A%3C/dd%3E%0D%0A%3C/dl%3E%0D%0A%3C/li%3E%0D%0A%3Cli%3E%0D%0A%3Cdl%3E%0D%0A%3Cdt%3E%0D%0A%3Cdiv%20class%3D%22news_time%20fnt_16%22%3E2021.05.13%3C/div%3E%0D%0A%3Ch3%20class%3D%22fnt_24%22%3E%3Ca%20href%3D%22/content/details32_5484.html%22%20target%3D%22_blank%22%3E%u5317%u8FB0%u5B9E%u4E1A%u7B2C%u4E5D%u5C4A%u7B2C%u4E00%u6B21%u76D1%u4E8B%u4F1A%u51B3%u8BAE%u516C%u544A%uFF08A%uFF09%3C/a%3E%3C/h3%3E%0D%0A%3C/dt%3E%0D%0A%3Cdd%3E%0D%0A%3Cp%20class%3D%22fnt_16%20line30%22%3E%20%20%20%20%u5317%u4EAC%u5317%u8FB0%u5B9E%u4E1A%u80A1%u4EFD%u6709%u9650%u516C%u53F8%uFF08%u4EE5%u4E0B%u7B80%u79F0%u201C%u672C%u516C%u53F8%u201D%uFF09%u7B2C%u4E5D%u5C4A%u76D1%u4E8B%u4F1A%u7B2C%u4E00%u6B21%u4F1A%20%u8BAE%u4E8E2021%u5E74%205%u6708%2013%20%u65E5%uFF08%u661F%u671F%u56DB%uFF09%u4EE5%u901A%u8BAF%u8868%u51B3%u65B9%u5F0F%u53EC%u5F00%u3002%u672C%u516C%u53F8%u76D1%u4E8B%u5171%205%u4EBA%uFF0C%u5168%20%u90E8%u53C2%u4E0E%u8868%u51B3%u3002%u672C%u6B21%u4F1A%u8BAE%u7684%u53EC%u5F00%u7B26%u5408%u516C%u53F8%u7AE0%u7A0B%u53CA%u6709%u5173%u6CD5%u5F8B%u6CD5%u89C4%u7684%u76F8%u5173%u89C4%u5B9A%u3002%3C/p%3E%0D%0A%3C/dd%3E%0D%0A%3C/dl%3E%0D%0A%3C/li%3E%0D%0A%3Cli%3E%0D%0A%3Cdl%3E%0D%0A%3Cdt%3E%0D%0A%3Cdiv%20class%3D%22news_time%20fnt_16%22%3E2021.05.13%3C/div%3E%0D%0A%3Ch3%20class%3D%22fnt_24%22%3E%3Ca%20href%3D%22/content/details32_5483.html%22%20target%3D%22_blank%22%3E%u5317%u8FB0%u5B9E%u4E1A%u7B2C%u4E5D%u5C4A%u7B2C%u4E00%u6B21%u8463%u4E8B%u4F1A%u51B3%u8BAE%u516C%u544A%uFF08A%uFF09%3C/a%3E%3C/h3%3E%0D%0A%3C/dt%3E%0D%0A%3Cdd%3E%0D%0A%3Cp%20class%3D%22fnt_16%20line30%22%3E%20%20%20%20%u5317%u4EAC%u5317%u8FB0%u5B9E%u4E1A%u80A1%u4EFD%u6709%u9650%u516C%u53F8%uFF08%u4EE5%u4E0B%u7B80%u79F0%u201C%u672C%u516C%u53F8%u201D%uFF09%u7B2C%u4E5D%u5C4A%u8463%u4E8B%u4F1A%u7B2C%u4E00%u6B21%u4F1A%u8BAE%20%u4E8E2021%u5E745%u6708%2013%u65E5%uFF08%u661F%u671F%u56DB%uFF09%u4EE5%u901A%u8BAF%u8868%u51B3%u65B9%u5F0F%u53EC%u5F00%u3002%u672C%u516C%u53F8%u8463%u4E8B%u51718%u4EBA%uFF0C%u5168%u90E8%20%u53C2%u4E0E%u8868%u51B3%u3002%u672C%u6B21%u4F1A%u8BAE%u7684%u53EC%u5F00%u7B26%u5408%u516C%u53F8%u7AE0%u7A0B%u53CA%u6709%u5173%u6CD5%u5F8B%u6CD5%u89C4%u7684%u76F8%u5173%u89C4%u5B9A%u3002%20%u9274%u4E8E%u672C%u516C%u53F82020%u5E74%u5E74%u5EA6%u80A1%u4E1C%u5927%u4F1A%u5DF2%u7ECF%u9009%u4E3E%u674E%u4F1F%u4E1C%u5148%u751F%u3001%u674E%u4E91%u5973%u58EB%u3001%u9648%u5FB7%u542F%u5148%20%u751F%u3001%u5F20%u6587%u96F7%u5973%u58EB%u3001%u90ED%u5DDD%u5148%u751F%u4E3A%u672C%u516C%u53F8%u7B2C%u4E5D%u5C4A%u8463%u4E8B%u4F1A%u6267%u884C%u8463%u4E8B%uFF0C%u9009%u4E3E%u5468%u6C38%u5065%u535A%u58EB%u3001%20%u7518%u57F9%u5FE0%u5148%u751F%u3001%u9648%u5FB7%u7403%u5148%u751F%u4E3A%u672C%u516C%u53F8%u7B2C%u4E5D%u5C4A%u8463%u4E8B%u4F1A%u72EC%u7ACB%u975E%u6267%u884C%u8463%u4E8B%u3002%20%3C/p%3E%0D%0A%3C/dd%3E%0D%0A%3C/dl%3E%0D%0A%3C/li%3E%0D%0A',page: '%3Cdiv%20class%3D%22page%22%3E%3Cdiv%20class%3D%22inner%22%3E%20%3Ca%20class%3D%22prev%20disable%22%20title%3D%22%u4E0A%u4E00%u9875%22%20href%3D%22havascript%3Avoid%280%29%3B%22%3E%u4E0A%u4E00%u9875%3C/a%3E%3Ca%20href%3D%22javascript%3Avoid%280%29%3B%22%20class%3D%22num%20on%22%3E1%3C/a%3E%3Ca%20title%3D%222%22%20href%3D%22javascript%3Aggthpagelist%28%27%27%2C2%29%3B%22%20class%3D%22num%22%3E2%3C/a%3E%3Ca%20title%3D%223%22%20href%3D%22javascript%3Aggthpagelist%28%27%27%2C3%29%3B%22%20class%3D%22num%22%3E3%3C/a%3E%3Ca%20title%3D%224%22%20href%3D%22javascript%3Aggthpagelist%28%27%27%2C4%29%3B%22%20class%3D%22num%22%3E4%3C/a%3E%3Ca%20title%3D%225%22%20href%3D%22javascript%3Aggthpagelist%28%27%27%2C5%29%3B%22%20class%3D%22num%22%3E5%3C/a%3E%3Ca%20title%3D%226%22%20href%3D%22javascript%3Aggthpagelist%28%27%27%2C6%29%3B%22%20class%3D%22num%22%3E6%3C/a%3E%3Ca%20title%3D%227%22%20href%3D%22javascript%3Aggthpagelist%28%27%27%2C7%29%3B%22%20class%3D%22num%22%3E7%3C/a%3E%3Ca%20title%3D%228%22%20href%3D%22javascript%3Aggthpagelist%28%27%27%2C8%29%3B%22%20class%3D%22num%22%3E8%3C/a%3E%3Ca%20title%3D%229%22%20href%3D%22javascript%3Aggthpagelist%28%27%27%2C9%29%3B%22%20class%3D%22num%22%3E9%3C/a%3E%3Ca%20title%3D%2210%22%20href%3D%22javascript%3Aggthpagelist%28%27%27%2C10%29%3B%22%20class%3D%22num%22%3E10%3C/a%3E%3Ca%20class%3D%22next%22%20href%3D%22javascript%3Aggthpagelist%28%27%27%2C2%29%3B%22%3E%u4E0B%u4E00%u9875%3C/a%3E%3Cspan%20class%3D%22txtpage%22%3E1/352%3C/span%3E%3Cspan%20class%3D%22txtnum%22%3E%3Cinput%20type%3D%22text%22%20value%3D%221%22%20name%3D%22%22%20id%3D%22gotopage%22%3E%20%3C/span%3E%3Cinput%20class%3D%22go%22%20type%3D%22text%22%20value%3D%22GO%22%20readonly%3D%22readonly%22%20onclick%3D%22if%28%21Number%28document.getElementById%28%27gotopage%27%29.value%29%29%7Balert%28%27%u8BF7%u8F93%u5165%u6570%u5B57%uFF01%27%29%3B%7Delse%7Bif%28Number%28document.getElementById%28%27gotopage%27%29.value%29%3E352%29%7Balert%28%27%u8F93%u5165%u7684%u6570%u5B57%u8FC7%u5927%uFF01%27%29%3B%7Delse%7B%20ggthpagelist%28%27%27%2C%20document.getElementById%28%27gotopage%27%29.value%29%20%7D%7D%22%20/%3E%3C/div%3E%3Cscript%3E%24%28document%29.ready%28function%28%29%7B%24%28%22%23gotopage%22%29.keydown%28function%28e%29%7Bvar%20curKey%20%3D%20e.which%3Bif%28curKey%20%3D%3D%2013%29%7Bif%28%21Number%28document.getElementById%28%27gotopage%27%29.value%29%29%7Balert%28%27%u8BF7%u8F93%u5165%u6570%u5B57%uFF01%27%29%3B%7Delse%7Bif%28Number%28document.getElementById%28%27gotopage%27%29.value%29%3E352%29%7Balert%28%27%u8F93%u5165%u7684%u6570%u5B57%u8FC7%u5927%uFF01%27%29%3B%7Delse%7B%20ggthpagelist%28%27%27%2C%20document.getElementById%28%27gotopage%27%29.value%29%20%7D%7Dreturn%20false%3B%7D%7D%29%3B%7D%29%3B%3C/script%3E%3C/div%3E'}"
    res = unquote_plus(res).replace("%u", "\\u").encode("utf-8").decode("unicode_escape")
    print(res)
    #obj.testRe()
    #obj.testFuzz()



